import React from 'react'
import { connect } from 'react-redux'
class ComD extends React.Component {
  handleClick = () => {
    this.props.subAction()
  }
  render() {
    return <button onClick={this.handleClick}>sub</button>
  }
}
const mapdispatchtoProps = (dispatch) => {
  return {
    subAction: () => {
      dispatch({
        type: 'sub_action',
      })
    },
  }
}
export default connect(null, mapdispatchtoProps)(ComD)
